<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@include file="/common/global.jsp"%>
<!DOCTYPE HTML>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>登陆</title>
    <link rel="stylesheet" type="text/css"
          href="${staticPath}/resources/jslib/bootstrap/css/bootstrap.css">
    <link rel="stylesheet" type="text/css"
          href="${staticPath}/resources/css/theme.css">
    <link rel="stylesheet"
          href="${staticPath}/resources/jslib/font-awesome/css/font-awesome.css">
    <script src="${staticPath}/resources/jslib/jquery-1.8.0.js"
            type="text/javascript"></script>

</head>
<body class="content1">
<div class="header">
    <h1 class="page-title">
        修改用户密码
    </h1>
</div>



<div class="container-fluid">
    <div class="row-fluid">
        <form method="post" action="${path}/bbsindex/upload" enctype="multipart/form-data">
            <div class="btn-toolbar">
                <input type="submit" class="btn btn-primary" value="上传">
                <a href="${path}/bbsindex/tolistbo" class="btn">取消</a>

            </div>

            <div class="well">
                <div class="tab-pane active in">

                    <input type="hidden" name="id" value="${param.id}">

                    <label class="mylabel">图书图片：</label>
                    <div style="text-align: center;width:200px;">
                    <span id="imgContent" class="mylabel">
							</span><br>
                    <a class="btn" href="javascript:void(0)" onclick="$('#img').click()">选择图片</a>
                     </div>

                    <div style="opacity:0;">
                        <input type="file" id="img" name="file" data-content="imgContent"/>
                    </div>


                </div>
            </div>
        </form>
    </div>
</div>
<script>
    window.onload=function(){
        //绑定图片事件
        $("#img").change(function(e) {
            $("#"+$(this).attr("data-content")).html('');
            for (var i = 0; i < this.files.length; i++) {
                $("#"+$(this).attr("data-content")).append('<img style="width:150px;height:150px;margin-left: 10px;" src="'+ getObjectURL(this.files[i])+'">');
            }
        });
    }
    function getObjectURL(file) {
        var url = null ;
        if (window.createObjectURL!=undefined) { // basic
            url = window.createObjectURL(file) ;
        } else if (window.URL!=undefined) { // mozilla(firefox)
            url = window.URL.createObjectURL(file) ;
        } else if (window.webkitURL!=undefined) { // webkit or chrome
            url = window.webkitURL.createObjectURL(file) ;
        }
        return url ;
    }
</script>
</body>
</html>
